package com.newlink.building.userinfo.mvp.contract

import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.common_base.model.bean.MessageCountRequest
import com.newlink.building.common_base.model.bean.MessageReadResult
import com.newlink.building.common_base.model.bean.PolicyAgreementData
import com.newlink.building.common_base.model.bean.UserInfoData
import io.reactivex.Observable

/**
 * @author wangyang
 * @date 2022/9/16
 * @description 我的页面的Contract
 */
interface Module_UserInfo_PersonalContract {

    interface Model : IModel {
        fun getUnreadFlag(token: String, type: Int): Observable<HttpResult<MessageReadResult>>
        fun getNoticeUnreadCount(token: String, type: Int): Observable<HttpResult<Int>>
        fun getUserInfo(token: String, userId: Long): Observable<HttpResult<UserInfoData>>
        fun logout(token: String): Observable<HttpResult<Boolean>>
        fun getLocalUnread(request: MessageCountRequest)
        fun getAgreement(): Observable<HttpResult<PolicyAgreementData>>
        fun getFAQ(): Observable<HttpResult<String?>>
    }

    interface View : IView {
        fun getUnreadFlagSuccess(haveUnread: Boolean?, msgNum: Int, noticeNum: Int)
        fun getNoticeUnreadFlagSuccess(haveUnread: Boolean?)
        fun getLocalUnreadSuccess(haveUnread: Boolean?)
        fun getUserInfoSuccess(userInfo: UserInfoData)
        fun logoutSuccess()
        fun onFail()
        fun onGetAgreementSuccess(data: PolicyAgreementData?)
        fun onGetFAQSuccess(url: String?)
    }

    interface Presenter : IPresenter<View> {
        fun getUnreadFlag(token: String, type: Int)
        fun getNoticeUnreadCount(token: String, type: Int)
        fun getLocalUnread(token: String, userId: Long)
        fun getUserInfo(token: String, userId: Long)
        fun logout(token: String)
        fun getAgreement()
        fun getFAQ()
    }
}